
*****************************************
* Do-File: Sanctuary cities in Europe   *
* David Kaufmann, kadavid@ethz.ch       *
* 25.05.2020                            *
*****************************************

clear
log using "\\d.ethz.ch\groups\baug\irl\spur_kadavid\Publikationen\4 Sanctuary cities in Europe\01_Paper\Stata\SanctuaryEurope", replace


cd "\\d.ethz.ch\groups\baug\irl\spur_kadavid\Publikationen\4 Sanctuary cities in Europe\01_Paper\Stata"


clear
insheet using basic.csv, c
save basic.dta, replace
clear
use basic.dta


******************************************************************
*** 1. Descriptive statistics*************************************
******************************************************************

recode nothing (0=1) (1=0), gen(policy)


histogram status, frequency kdensity
histogram services, frequency kdensity
histogram population, frequency kdensity
histogram city_state, frequency kdensity
histogram foreign_pop, frequency kdensity
histogram mayor_lr, frequency kdensity
histogram gdp_pc, frequency kdensity


***logarithmic function***
gen log_population=ln(population)
gen log_gdp_pc=ln(gdp_pc)

histogram log_population, frequency kdensity
histogram log_gdp_pc, frequency kdensity

***Recode GDP_pc***
gen gdp_pc1000=gdp_pc/1000




******************************************************************
*** 2. Regressions ***********************************************
******************************************************************


***Model 1, all policies***
logit policy log_population foreign_pop mayor_lr, vce(cluster n_cntry)
logit policy gdp_pc1000 foreign_pop mayor_lr, vce(cluster n_cntry)

vif, uncentered


***Model 2, service policies***
logit services log_population foreign_pop mayor_lr, vce(cluster n_cntry)
logit services gdp_pc1000 foreign_pop mayor_lr, vce(cluster n_cntry)

vif, uncentered


*** Correlation Table ***
corr policy status services population gdp_pc foreign_pop mayor_lr city_state

estpost corr policy status services population gdp_pc foreign_pop mayor_lr city_state, matrix listwise
eststo corr
esttab corr using corr_tab.rtf, unstack not noobs compress


